1 /* 2 * The MIT License (MIT) 3 * 4 * Copyright (c) 2014 Devisualization (Richard Andrew Cattermole) 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in all 14 * copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 */ 24 module devisualization.util.opengl.function_wrappers.v13; 25 import gl = derelict.opengl3.gl; 26 public import devisualization.util.opengl.function_wrappers.v10 : InternalFormat; 27 public import devisualization.util.opengl.function_wrappers.v11 : CompressedTextureTargets2D; 28 public import devisualization.util.opengl.function_wrappers.v12 : TextureTargets; 29 30 enum TextureTargets2D { 31 Texture2D = gl.GL_TEXTURE_2D, 32 ProxyTexture2D = gl.GL_PROXY_TEXTURE_2D, 33 Texture1DArray = gl.GL_TEXTURE_1D_ARRAY, 34 ProxyTexture1DArray = gl.GL_PROXY_TEXTURE_1D_ARRAY, 35 TextureCubeMapPositiveX = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 36 TextureCubeMapNegativeX = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 37 TextureCubeMapPositiveY = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 38 TextureCubeMapNegativeY = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 39 TextureCubeMapPositiveZ = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 40 TextureCubeMapNegativeZ = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 41 ProxyTextureCubeMap = gl.GL_PROXY_TEXTURE_CUBE_MAP 42 } 43 44 enum TextureTargets1D { 45 Texture1D = gl.GL_TEXTURE_1D, 46 ProxyTexture1D = gl.GL_PROXY_TEXTURE_1D 47 } 48 49 enum CompressedTextureTargets { 50 Texture1D = gl.GL_TEXTURE_1D, 51 Texture2D = gl.GL_TEXTURE_2D, 52 Texture3D = gl.GL_TEXTURE_3D, 53 TextureCubeMapPositiveX = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 54 TextureCubeMapNegativeX = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 55 TextureCubeMapPositiveY = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 56 TextureCubeMapnegativeY = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 57 TextureCubeMapPositiveZ = gl.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 58 TextureCubeMapNegativeZ = gl.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 59 } 60 61 void glActiveTexture(uint texture = 0) 62 in { 63 assert(texture < gl.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS); 64 } body { 65 gl.glActiveTexture(gl.GL_TEXTURE0 + texture); 66 } 67 68 void glSampleCoverage(float value, bool invert) 69 in { 70 assert(value <= 1); 71 assert(value >= 0); 72 } body { 73 gl.glSampleCoverage(value, cast(gl.GLboolean)invert); 74 } 75 76 void glCompressedTexImage3D(TextureTargets target, int level, InternalFormat internalFormat, int width, int height, int depth, void[] data) 77 in { 78 assert(level >= 0); 79 } body { 80 gl.glCompressedTexImage3D(cast(gl.GLenum)target, level, cast(gl.GLenum)internalFormat, width, height, depth, 0, cast(uint)data.length, data.ptr); 81 } 82 83 void glCompressedTexImage2D(TextureTargets2D target, int level, InternalFormat internalFormat, int width, int height, void[] data) 84 in { 85 assert(level >= 0); 86 } body { 87 gl.glCompressedTexImage2D(cast(gl.GLenum)target, level, cast(gl.GLenum)internalFormat, width, height, 0, cast(uint)data.length, data.ptr); 88 } 89 90 void glCompressedTexImage1D(TextureTargets1D target, int level, InternalFormat internalFormat, int width, void[] data) 91 in { 92 assert(level >= 0); 93 } body { 94 gl.glCompressedTexImage1D(cast(gl.GLenum)target, level, cast(gl.GLenum)internalFormat, width, 0, cast(uint)data.length, data.ptr); 95 } 96 97 void glCompressedTexSubImage3D(int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, InternalFormat internalFormat, void[] data) 98 in { 99 assert(level >= 0); 100 } body { 101 gl.glCompressedTexSubImage3D(gl.GL_TEXTURE_3D, level, xoffset, yoffset, zoffset, width, height, depth, internalFormat, cast(uint)data.length, data.ptr); 102 } 103 104 void glCompressedTexSubImage2D(CompressedTextureTargets2D target, int level, int xoffset, int yoffset, int width, int height, InternalFormat internalFormat, void[] data) 105 in { 106 assert(level >= 0); 107 } body { 108 gl.glCompressedTexSubImage2D(cast(gl.GLenum)target, level, xoffset, yoffset, width, height, internalFormat, cast(uint)data.length, data.ptr); 109 } 110 111 void glCompressedTexSubImage1D(int level, int xoffset, int width, InternalFormat internalFormat, void[] data) 112 in { 113 assert(level >= 0); 114 } body { 115 gl.glCompressedTexSubImage1D(gl.GL_TEXTURE_1D, level, xoffset, width, internalFormat, cast(uint)data.length, data.ptr); 116 } 117 118 void[] glGetCompressedTexImage(CompressedTextureTargets target, int lod) { 119 void[] ret; 120 gl.glGetCompressedTexImage(cast(gl.GLenum)target, lod, ret.ptr); 121 return ret; 122 }